package com.sizu.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sizu.entity.TCustomerReturnList;
import com.sizu.mapper.TCustomerReturnListMapper;
import com.sizu.service.ITCustomerReturnListService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 赵玉玺
 * @since 2020-03-16
 */
@Service
public class TCustomerReturnListServiceImpl extends ServiceImpl<TCustomerReturnListMapper, TCustomerReturnList> implements ITCustomerReturnListService {

    @Override
    public boolean upTCustomerReturnListState(String number) {
        Wrapper<TCustomerReturnList> tCustomerReturnListWrapper=new EntityWrapper<>();
        tCustomerReturnListWrapper.eq("customer_return_number",number);
        TCustomerReturnList tCustomerReturnList=new TCustomerReturnList();
        tCustomerReturnList.setState(2);
        this.baseMapper.update(tCustomerReturnList,tCustomerReturnListWrapper);
        return true;
    }

    @Override
    public List<TCustomerReturnList> getTCustomerReturnList() {
        Wrapper<TCustomerReturnList> tCustomerReturnListWrapper=new EntityWrapper<>();
        tCustomerReturnListWrapper.eq("state","1");
        List<TCustomerReturnList> tCustomerReturnLists = this.baseMapper.selectList(tCustomerReturnListWrapper);
        return tCustomerReturnLists;
    }
}
